package com.share.finance.asset.sjd.web;

import com.share.common.common.Page;
import com.share.common.common.Result;
import com.share.finance.asset.sjd.model.vo.BindCardVo;
import com.share.finance.asset.sjd.model.vo.UserPageReq;
import com.share.finance.asset.sjd.service.IUserBindCardService;
import com.share.finance.asset.sjd.service.IUserInfoService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户基本信息  前端控制器
 * </p>
 *
 * @author author
 * @since 2023-09-08
 */
@RestController
public class UserInfoController {
    @Autowired
    private IUserInfoService userInfoService;

    @Autowired
    private IUserBindCardService userBindCardService;

    @ApiOperation("用户-分页查询")
    @RequestMapping(value = "/userinfo/pageList")
    public Result logPageList(UserPageReq req) {
        Page page = userInfoService.pageList(req);
        return Result.success(page);
    }

    @ApiOperation("用户-绑卡")
    @RequestMapping(value = "/userinfo/bindCard")
    public Result bindCard(@RequestBody BindCardVo req) {
        int status = userBindCardService.bindCard(req);
        return Result.success(status);
    }
}
